<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>管理员详情</title>
    <link rel="stylesheet" href="../../layui/css/layui.css" />
    <style>
        .layui-input {
            width: 220px;
        }
        .layui-form-item{
            margin-top: 5px;
            padding-bottom: 15px;
        }
    </style>
</head>
<body>
<form class="layui-form" action="" lay-filter="upd">
    <input type="hidden" id="aid" name="aid">
    <div class="layui-form-item">
        <label class="layui-form-label">账号</label>
        <div class="layui-input-inline">
            <input type="text" name="auser" id="auser" required  lay-verify="required"  autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
            <input type="text" name="apassword" id="apassword" required  lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-inline">
            <input type="text" name="aname" id="aname" required  lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-inline">
            <input type="text" name="asex" id="asex" required  lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机</label>
        <div class="layui-input-inline">
            <input type="text" name="aphone" id="aphone" required  lay-verify="required|phone" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-inline">
            <input type="text" name="aemail" id="aemail" required  lay-verify="required|email" autocomplete="off" class="layui-input">
        </div>
    </div>
</form>
<script src="/static/js/jquery-3.3.1.js"></script>
<script src="/static/layui/layui.js"></script>
<script>
    //Demo
    layui.use(['form','laydate'], function(){
        var form = layui.form;
        var $=layui.$;
        $().ready(function () {
            $.ajax({
                url: "/adminqueryone",
                type: "get",
                dataType: "json",
                data: {"aid": getQueryString("aid")},
                success: function (da) {
                    var aaa=da.data;
                    if (da.code == 0) {
                        $.each(da.data,function (update,u) {
                            $('#aid').val(u.aid);
                            $('#auser').val(u.auser);
                            $('#apassword').val(u.apassword);
                            $('#aname').val(u.aname);
                            $("#asex").val(u.asex);
                            $("#aphone").val(u.aphone);
                            $('#aemail').val(u.aemail);
                            //$('#ctime').val(layui.util.toDateString(u.ctime,'yyyy-MM-dd'));
                        });
                        form.render();
                    } else {
                        layer.msg("查询数据失败！");
                    }
                }
            })
        });
        $(function () {
            $("input").prop("disabled", "disabled");
            // $("textarea").prop("disabled", "disabled");
        });

    //获取传来的？后的 字段参数
        function getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return unescape(r[2]);
            }
            return null;
        }
    })
</script>
</body>
</html>